#include"processbar.h"
void process_bar(const int& speed)
{
    
    const char* bar = "|/-\\";
    char str[NUM] = {0};
    int n = 0;
    int cur = 0;
    while(n < NUM)
    {
      int len = strlen(bar);
      printf("[%-100s][%d%%][%c]\r",str,n,bar[cur]);
      fflush(stdout);
      str[n] = BODY;
      str[++n] = RIGHT; 
      if(cur==len)
      {
        cur=0;
      }
      else
        cur++;
      usleep(speed);
    }
    cout<<endl;
 
}





